#ifndef CPP_CIRCLE_PROGRESS_BAR_H
#define CPP_CIRCLE_PROGRESS_BAR_H

#include <Bitmap.h>
#include <widget/ProgressBar.h>

//注意：CircleProgressBar setSize是高度一定要是偶数，否则显示会异常

//@brief 环形进度条控件
//@author cvte
//@description 支持环形/扇形进度条效果
class CircleProgressBar : public ProgressBar {
   public:
    CircleProgressBar();
    ~CircleProgressBar();

    void setStartDegree(int degree);

   protected:
    void onDraw(Canvas& canvas);
    int pointToProgress(int x, int y);

   private:
    int mStartDegree = 0;
};

#endif